﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GraphLibrary.Algorithms;

namespace GraphLibrary
{
    public class DirectedGraph<TVertex, TEdge> : Graph<TVertex, TEdge>, IDirectedGraph<TVertex, TEdge>
        where TEdge : IEdge<TVertex>
    {
        private bool Acyclic = true;

        public bool IsAcyclic
        {
            get
            {
                DepthFirstSearch<TVertex, TEdge> dfs = new DepthFirstSearch<TVertex, TEdge>(this);
                dfs.CycleHasBeenFound += delegate
                {
                    Acyclic = false;
                };
                return Acyclic;
            }
        }
    }
}
